<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
class User extends DataMapper {

    var $prefix = "auth_";

    var $validation = array(
        'user_name' => array(
            'label' => 'User name',
            'rules' => array('required', 'trim', 'alpha_dash', 'max_length' => 50)
        ),
        'password' => array(
            'label' => 'Password',
            'rules' => array('required', 'trim', 'max_length' => 255)
        ),
        'email' => array('Email',
            'rules' => array('required', 'trim', 'valid_email', 'max_length' => 100)
        ),
        'role_id' => array(
            'label' => 'Role ID',
            'rules' => array('required', 'trim', 'numeric')
        ),
        'activated' => array(
            'label' => 'Activated',
            'rules' => array('required', 'trim', 'numeric')
        ),
        'banned' => array(
            'label' => 'Banned',
            'rules' => array('required', 'trim', 'numeric')
        ),
        'ban_reason' => array(
            'label' => 'Ban reason',
            'rules' => array('trim', 'max_length' => 255)
        ),
        'new_password_key' => array(
            'label' => 'New password key',
            'rules' => array('trim', 'max_length' => 50)
        ),
        'new_password_requested' => array(
            'label' => 'Banned',
            'rules' => array('trim', 'valid_date')
        ),
        'new_email' => array(
            'label' => 'New email',
            'rules' => array('trim', 'valid_email', 'max_length' => 100)
        ),
        'new_email_key' => array(
            'label' => 'New email key',
            'rules' => array('trim', 'max_length' => 50)
        ),
        'last_ip' => array(
            'label' => 'Last IP',
            'rules' => array('required', 'trim', 'valid_ip', 'max_length' => 40)
        ),
        'last_login' => array(
            'label' => 'Last login',
            'rules' => array('required', 'trim', 'valid_date')
        ),
        'created' => array(
            'label' => 'Created',
            'rules' => array('required', 'trim', 'valid_date')
        ),
        'modified' => array(
            'label' => 'Modified',
            'rules' => array('required', 'trim')
        )
    );

}